home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5411 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.3 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Unbuffered character input...
  5. Date: Thu, 08 Feb 96 15:45:47 GMT
  6. Organization: none
  7. Message-ID: <823794347snz@genesis.demon.co.uk>
  8. References: <Pine.SGI.3.91.960129190205.27936A-100000@tahiti.cs.unm.edu> <9602022043.AA13287@dxmint.cern.ch> <4f7hlf$87n@airdmhor.gen.nz> <9602061701.AA21789@dxmint.cern.ch> <4f8kat$ofv@solutions.solon.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4f8kat$ofv@solutions.solon.com>
  15.            seebs@solutions.solon.com "Peter Seebach" writes:
  16.  
  17. >In article <9602061701.AA21789@dxmint.cern.ch>,
  18. >Dan Pop  <danpop@mail.cern.ch> wrote:
  19. >>But even on systems where it is not, it still saves processor time.
  20. >>The cpu overhead of making a single OS call to get a complete line of input
  21. >>is smaller (sometimes significantly smaller) than the overhead of making
  22. >>N OS calls, one for each character of the line.  The stdio library tries
  23. >>to do its best to minimize the number of (expensive) OS calls.
  24.  
  25. The stdio library typically reads characters as soon as they are available
  26. so it does very little in this respect except provide suitable buffering
  27. when more than one character happens to be available on a read. This is
  28. clearly significant for file I/O but whether terminal I/O makes user typed
  29. characters immediately available or not is usually purely a function of the
  30. OS. Setting line buffering on input streams on many/most stdio libraries
  31. doesn't do anything special.
  32.  
  33. >Further, in some cases, it can be dramatically more uer efficient
  34. >and user friendly to be line buffered.  The keyboard I'm typing
  35. >on right now is about 30 gateways from the editor I'm typing to.
  36. >If I were using a line buffered system, I would be able to see and correct
  37. >my typos *instantly* (Would you believe less than 50 msec.
  38. ...
  39.  
  40. This is an argument for including support for line buffering, not against
  41. including support for unbuffered input. Both have their uses.
  42.  
  43. -- 
  44. -----------------------------------------
  45. Lawrence Kirby | fred@genesis.demon.co.uk
  46. Wilts, England | 70734.126@compuserve.com
  47. -----------------------------------------
  48.